import { iframeMessageHeader } from '@/js/api.config.js'
$(function() {
	let local_url = window.location.search;
	let local_arr = local_url.split("&");
	let length_local = local_arr.length;
	let state, code, error, params;
	if(length_local <= 2) {
		$("#textTip").html("您已取消认证");
		error = local_arr[0].split("=")[1];
		params = {
			"error":error
		}
	}else if(length_local == 3){
		$("#textTip").html("您已认证成功");
		state = local_arr[0].split("=")[1];
		code = local_arr[1].split("=")[1];
		params = {
			"state":state,
			"code":code
		}
	}
	window.opener.postMessage(JSON.stringify(params), iframeMessageHeader());
});